package h0721;

import java.util.Scanner;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
  * @description TODO
  * @author 不知名帅哥
  * @date 2024/7/21 21:18
  * @version 1.0
*/
public class CheckKeyFormat {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int k = Integer.parseInt(sc.nextLine());
        String keys = sc.nextLine();

        System.out.println(getResult(k, keys));
//TODO 我的方法
//        Pattern p = Pattern.compile("(\\w+-)");
//        Matcher matcher = p.matcher(keys);
//        //找到第一个字符串。
//        String first = null;
//        if (matcher.find()) {
//            first = matcher.group(1);
//        }
//        int index = first.length();
//        String second = keys.substring(index).replaceAll("-", "").toUpperCase();
//        int count = 0;
//        StringBuilder stringBuilder = new StringBuilder();
//        for (char c : second.toCharArray()) {
//            if (count == k) {
//                stringBuilder.append('-');
//            }
//            stringBuilder.append(c);
//            count++;
//        }
//        System.out.println(first + stringBuilder.toString());
    }

    private static String getResult(int k,String s){
        String[] sArr=s.split("-");
        String first=sArr[0];
        if (sArr.length==1){
            return first;
        }
        StringBuilder sb=new StringBuilder();

        for (int i = 1; i < sArr.length; i++) {
            sb.append(sArr[i]);
        }
        String[] tmp=sb.toString().toUpperCase().split("");
        for (int i = 0; i < sb.length(); i++) {
            if (i%k==0){
                tmp[i]="-"+tmp[i];
            }
        }
        return first+String.join("",tmp);
    }
}
